翻訳と辞書
Words near each other
・ Loop start
・ Loop subdivision surface
・ Loop the Loop (Coney Island)
・ Loop the Loop (Olentangy Park)
・ Loop the Loop (Young's Million Dollar Pier)
・ Loop theorem
・ Loop tiling
・ Loop unrolling
・ Loop unswitching
・ Loop v. Litchfield
・ Loop variant
・ Loop, Germany
・ Loop, Texas
・ Loop, West Virginia
・ Loop-erased random walk
Loop-invariant code motion
・ Loop-mediated isothermal amplification
・ Loop-O-Plane
・ Loop-switch sequence
・ Loop-the-Loop (disambiguation)
・ Loop-the-Loop (song)
・ Loopallu Festival
・ Loopback
・ Loopback device
・ LoopCo
・ Loope, California
・ Loopealse
・ Loopebach
・ Looped
・ Looped square


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Loop-invariant code motion : ウィキペディア英語版
Loop-invariant code motion

In computer programming, loop-invariant code consists of statements or expressions (in an imperative programming language) which can be moved outside the body of a loop without affecting the semantics of the program. Loop-invariant code motion (also called hoisting or scalar promotion) is a compiler optimization which performs this movement automatically.
==Example==
If we consider the following code sample, two optimizations can be easily applied.

for (int i = 0; i < n; i++)

The calculation x = y + z and x
* x
can be moved outside the loop since within they are loop invariant— they do not change over the iterations of the loop— so the optimized code will be something like this:

x = y + z;
t1 = x
* x;
for (int i = 0; i < n; i++)

This code can be optimized further. For example, strength reduction could remove the two multiplications inside the loop (6
*i
and a()), and induction variable elimination could then elide i completely. Since 6
* i
must be in lock step with i itself, there is no need to have both.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Loop-invariant code motion」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.